<template>
  <h1>{{ msg }}</h1>
  <button @click="add">count is: {{ count }}</button>
  <p>Edit <code>components/HelloWorld.vue</code> to test hot module replacement.</p>

</template>

<script>
import { computed } from "vue";
import { useStore } from "vuex";
export default {
  name: 'HelloWorld',
  props: {
    msg: String
  },
  setup() {
    const store = useStore()

    const count = computed(() => store.state.count * 2);

    function add(){
      store.commit("add")
    }

    return {count,add}
  }
}
</script>
